import request from '@/utils/request'

// 创建物料信息
export function createMaterial(data) {
  return request({
    url: '/hs/material/create',
    method: 'post',
    data: data
  })
}

// 更新物料信息
export function updateMaterial(data) {
  return request({
    url: '/hs/material/update',
    method: 'put',
    data: data
  })
}

// 删除物料信息
export function deleteMaterial(id) {
  return request({
    url: '/hs/material/delete?id=' + id,
    method: 'delete'
  })
}

// 获得物料信息
export function getMaterial(id) {
  return request({
    url: '/hs/material/get?id=' + id,
    method: 'get'
  })
}

// 获得物料信息分页
export function getMaterialPage(params) {
  return request({
    url: '/hs/material/page',
    method: 'get',
    params
  })
}

// 获得物料质检信息分页
export function getMaterialQcPage(params) {
  return request({
    url: '/hs/material/qc-page',
    method: 'get',
    params
  })
}

// 导出物料信息 Excel
export function exportMaterialExcel(params) {
  return request({
    url: '/hs/material/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获得物料机型分页
export function getMaterialModePage(params) {
  return request({
    url: '/hs/material/mode-page',
    method: 'get',
    params
  })
}
